import { uniFetch } from './uni-fetch.js'

// 待提货列表
export const list = (status, page, pageSize) => {
  return uniFetch.get('/driver/tasks/list', { status, page, pageSize })
}

// 待提货详情
export const detail = (id) => {
  if (!id) return
  return uniFetch.get(`/driver/tasks/details/${id}`)
}
// 延迟提货提交
export const delay = (data) => {
  if (!data.id) return
  return uniFetch.put('/driver/tasks/delay', data)
}

export const pickup = (data) => {
  return uniFetch.post('/driver/tasks/takeDelivery', data)
}

export const except = (data) => {
  return uniFetch.post('/driver/tasks/reportException', data)
}

// 交付
export const deliver = (data) => {
  if (!data.id) return
  return uniFetch.post('/driver/tasks/deliver', data)
}

// 回车登记
export const record = (data) => {
  if (!data.id) return
  return uniFetch.post('/driver/tasks/truckRegistration', data)
}
